package com.xk.jdbc;

import java.sql.Date;
import java.util.List;

public class Test {
    public static void main(String[] args) {
        TestDaoImpl testDao = new TestDaoImpl();
        
        try {
            // 创建 Person 对象
            Person person = new Person(2, "李四", 21, DateUtils.utilToSql(DateUtils.strToUtil("1999-11-05")), "erf@qq.com", "上海市");

            // 删除数据
            testDao.delete(2);

            // 查询所有信息
            List<Person> personList = testDao.selectAll();
            if (personList != null && !personList.isEmpty()) {
                System.out.println("查询到结果：\n" + personList);
            } else {
                System.out.println("未找到对应记录！");
            }
        } catch (Exception e) {
            System.err.println("发生错误：" + e.getMessage());
            e.printStackTrace();
        }
    }
}